<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3.跨域问题_限制Ajax获取数据</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>

<body>
    <button onclick="getNew()">获取头条新闻</button>

    <script type="text/javascript">
        async function getNew() {
            const url = 'https://www.toutiao.com/hot-event/hot-board/?origin=toutiao_pc'
            let result = await fetch(url)
            let data = await result.json()
            console.log(data);

        }
    </script>
</body>

</html>